//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by FernFlower decompiler)
//

package com.example.mapper;

import com.example.entity.Student;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

public interface StudentMapper {
    List<Student> selectAll(Student student);

    @Select({"select * from student where id = #{id}"})
    Student selectById(Integer id);

    @Insert({"insert into student (username,password,role,name,sex,major,descr,avatar,contact_info) values (#{username},#{password},#{role},#{name},#{sex},#{major},#{descr},#{avatar},#{contactInfo})"})
    int insert(Student student);//后端_，前端驼峰

    @Update({"update student set username = #{username}, password= #{password}, role= #{role},name = #{name}, sex = #{sex},major = #{major},contact_info = #{contactInfo},descr = #{descr},avatar = #{avatar} where id=#{id}"})
    int updateById(Student student);

    @Delete({"delete from student where id = #{id}"})
    int deleteById(Integer id);

    @Select({"select * from student where username = #{username}"})
    Student selectByUsername(String username);

    @Select({"select * from student where no = #{no}"})
    Student selectByNo(String no);
}
